﻿<%@ Import Namespace="eCRAM.Model" %>
<%@ Import Namespace="eCRAM.WebSite.Models" %>
<%@ Import Namespace="eCRAM.UIElement" %>
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<%@ Import Namespace="eCRAM.WebSite.Tools" %>

<%
    if (Request.IsAuthenticated) {
        
        var menuTabList = new List<MenuTab>();

        if (SessionTools.User != null)
        {
            menuTabList.Add(MenuTab.Create("CRAM", "Index", "Cram"));
            if (SessionTools.User.Role == (int)UserRole.Administrator)
            {
                menuTabList.Add(MenuTab.Create("Recherche", "Index", "Search"));
                menuTabList.Add(MenuTab.Create("Validation", "GetCramsToValid", "Search"));
                menuTabList.Add(MenuTab.Create("Métriques", "Index", "ProjectResume"));
                menuTabList.Add(MenuTab.Create("Administration", "Index", "ReferenceData"));
                menuTabList.Add(MenuTab.Create("Export", "ExportCrams", "Export"));


            }
            else if (SessionTools.User.Role == (int)UserRole.ProjectLeader)
            {
                menuTabList.Add(MenuTab.Create("Recherche", "Index", "Search"));
                menuTabList.Add(MenuTab.Create("Validation", "GetCramsToValid", "Search"));
                menuTabList.Add(MenuTab.Create("Métriques", "Index", "ProjectResume"));
            }
        }
        %><%= Html.TabbedMenu(menuTabList)%>
<%
    }
 
%>
